home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat1
/
X11
/
imake.z
/
imake
Wrap
Text File
|
1998-10-30
|
14KB
|
331 lines
IIIIMMMMAAAAKKKKEEEE((((1111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111)))) IIIIMMMMAAAAKKKKEEEE((((1111))))
NNNNAAAAMMMMEEEE
imake - C preprocessor interface to the make utility
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
iiiimmmmaaaakkkkeeee [ ----DDDD_d_e_f_i_n_e ] [ ----IIII_d_i_r ] [ ----TTTT_t_e_m_p_l_a_t_e ] [ ----ffff _f_i_l_e_n_a_m_e ]
[ ----CCCC _f_i_l_e_n_a_m_e ] [ ----ssss _f_i_l_e_n_a_m_e ] [ ----eeee ] [ ----vvvv ]
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_I_m_a_k_e is used to generate _M_a_k_e_f_i_l_e_s from a template, a set
of _c_p_p macro functions, and a per-directory input file
called an _I_m_a_k_e_f_i_l_e. This allows machine dependencies (such
as compiler options, alternate command names, and special
_m_a_k_e rules) to be kept separate from the descriptions of the
various items to be built.
OOOOPPPPTTTTIIIIOOOONNNNSSSS
The following command line options may be passed to _i_m_a_k_e:
----DDDD_d_e_f_i_n_e
This option is passed directly to _c_p_p. It is
typically used to set directory-specific variables.
For example, the X Window System uses this flag to
set _T_O_P_D_I_R to the name of the directory containing
the top of the core distribution and _C_U_R_D_I_R to the
name of the current directory, relative to the top.
----IIII_d_i_r_e_c_t_o_r_y
This option is passed directly to _c_p_p. It is
typically used to indicate the directory in which
the _i_m_a_k_e template and configuration files may be
found.
----TTTT_t_e_m_p_l_a_t_e
This option specifies the name of the master
template file (which is usually located in the
directory specified with -_I) used by _c_p_p. The
default is _I_m_a_k_e._t_m_p_l.
----ffff _f_i_l_e_n_a_m_e
This option specifies the name of the per-directory
input file. The default is _I_m_a_k_e_f_i_l_e.
----CCCC _f_i_l_e_n_a_m_e
This option specifies the name of the .c file that
is constructed in the current directory. The
default is _I_m_a_k_e_f_i_l_e._c.
----ssss _f_i_l_e_n_a_m_e
This option specifies the name of the _m_a_k_e
description file to be generated but _m_a_k_e should not
be invoked. If the _f_i_l_e_n_a_m_e is a dash (-), the
output is written to _s_t_d_o_u_t. The default is to
Page 1 (printed 4/30/98)
IIIIMMMMAAAAKKKKEEEE((((1111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111)))) IIIIMMMMAAAAKKKKEEEE((((1111))))
generate, but not execute, a _M_a_k_e_f_i_l_e.
----eeee This option indicates the _i_m_a_k_e should execute the
generated _M_a_k_e_f_i_l_e. The default is to leave this to
the user.
----vvvv This option indicates that _i_m_a_k_e should print the
_c_p_p command line that it is using to generate the
_M_a_k_e_f_i_l_e.
HHHHOOOOWWWW IIIITTTT WWWWOOOORRRRKKKKSSSS
_I_m_a_k_e invokes _c_p_p with any -_I or -_D flags passed on the
command line and passes the name of a file containing the
following 3 lines:
#define IMAKE_TEMPLATE "Imake.tmpl"
#define INCLUDE_IMAKEFILE <Imakefile>
#include IMAKE_TEMPLATE
where _I_m_a_k_e._t_m_p_l and _I_m_a_k_e_f_i_l_e may be overridden by the -_T
and -_f command options, respectively.
The IMAKE_TEMPLATE typically reads in a file containing
machine-dependent parameters (specified as _c_p_p symbols), a
site-specific parameters file, a file defining variables, a
file containing _c_p_p macro functions for generating _m_a_k_e
rules, and finally the _I_m_a_k_e_f_i_l_e (specified by
INCLUDE_IMAKEFILE) in the current directory. The _I_m_a_k_e_f_i_l_e
uses the macro functions to indicate what targets should be
built; _i_m_a_k_e takes care of generating the appropriate rules.
_I_m_a_k_e configuration files contain two types of variables,
imake variables and make variables. The imake variables are
interpreted by cpp when _i_m_a_k_e is run. By convention they
are mixed case. The make variables are written into the
_M_a_k_e_f_i_l_e for later interpretation by _m_a_k_e. By convention
make variables are upper case.
The rules file (usually named _I_m_a_k_e._r_u_l_e_s in the
configuration directory) contains a variety of _c_p_p macro
functions that are configured according to the current
platform. _I_m_a_k_e replaces any occurrences of the string
``@@'' with a newline to allow macros that generate more
than one line of _m_a_k_e rules. For example, the macro
#define program_target(program, objlist) @@\
program: objlist @@\
$(CC) -o $@ objlist $(LDFLAGS)
when called with _p_r_o_g_r_a_m__t_a_r_g_e_t(_f_o_o, _f_o_o_1._o _f_o_o_2._o) will
expand to
Page 2 (printed 4/30/98)
IIIIMMMMAAAAKKKKEEEE((((1111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111)))) IIIIMMMMAAAAKKKKEEEE((((1111))))
foo: foo1.o foo2.o
$(CC) -o $@ foo1.o foo2.o $(LDFLAGS)
_I_m_a_k_e also replaces any occurrences of the word ``XCOMM''
with the character ``#'' to permit placing comments in the
Makefile without causing ``invalid directive'' errors from
the preprocessor.
Some complex _i_m_a_k_e macros require generated _m_a_k_e variables
local to each invocation of the macro, often because their
value depends on parameters passed to the macro. Such
variables can be created by using an _i_m_a_k_e variable of the
form XXXXVVVVAAAARRRRddddeeeeffff_n, where _n is a single digit. A unique _m_a_k_e
variable will be substituted. Later occurrences of the
variable XXXXVVVVAAAARRRRuuuusssseeee_n will be replaced by the variable created
by the corresponding XXXXVVVVAAAARRRRddddeeeeffff_n.
On systems whose _c_p_p reduces multiple tabs and spaces to a
single space, _i_m_a_k_e attempts to put back any necessary tabs
(_m_a_k_e is very picky about the difference between tabs and
spaces). For this reason, colons (:) in command lines must
be preceded by a backslash (\).
UUUUSSSSEEEE WWWWIIIITTTTHHHH TTTTHHHHEEEE XXXX WWWWIIIINNNNDDDDOOOOWWWW SSSSYYYYSSSSTTTTEEEEMMMM
The X Window System uses _i_m_a_k_e extensively, for both full
builds within the source tree and external software. As
mentioned above, two special variables, _T_O_P_D_I_R and _C_U_R_D_I_R,
are set to make referencing files using relative path names
easier. For example, the following command is generated
automatically to build the _M_a_k_e_f_i_l_e in the directory _l_i_b/_X/
(relative to the top of the sources):
% ../.././config/imake -I../.././config \
-DTOPDIR=../../. -DCURDIR=./lib/X
When building X programs outside the source tree, a special
symbol _U_s_e_I_n_s_t_a_l_l_e_d is defined and _T_O_P_D_I_R and _C_U_R_D_I_R are
omitted. If the configuration files have been properly
installed, the script _x_m_k_m_f(1) may be used.
IIIINNNNPPPPUUUUTTTT FFFFIIIILLLLEEEESSSS
Here is a summary of the files read by _i_m_a_k_e as used by X.
The indentation shows what files include what other files.
Imake.tmpl generic variables
site.def site-specific, BeforeVendorCF defined
*.cf machine-specific
*Lib.rules shared library rules
site.def site-specific, AfterVendorCF defined
Imake.rules rules
X11.tmpl X-specific variables
Page 3 (printed 4/30/98)
IIIIMMMMAAAAKKKKEEEE((((1111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111)))) IIIIMMMMAAAAKKKKEEEE((((1111))))
*Lib.tmpl shared library variables
Imakefile
Library.tmpl library rules
Server.tmpl server rules
Threads.tmpl multi-threaded rules
Note that _s_i_t_e._d_e_f gets included twice, once before the *._c_f
file and once after. Although most site customizations
should be specified after the *._c_f file, some, such as the
choice of compiler, need to be specified before, because
other variable settings may depend on them.
The first time _s_i_t_e._d_e_f is included, the variable
BeforeVendorCF is defined, and the second time, the variable
AfterVendorCF is defined. All code in _s_i_t_e._d_e_f should be
inside an #ifdef for one of these symbols.
FFFFIIIILLLLEEEESSSS
Imakefile.c temporary input file for cpp
/tmp/Imf.XXXXXX temporary Makefile for -s
/tmp/IIf.XXXXXX temporary Imakefile if
specified Imakefile uses # comments
/lib/cpp default C preprocessor
SSSSEEEEEEEE AAAALLLLSSSSOOOO
make(1), xmkmf(1)
S. I. Feldman, _M_a_k_e - _A _P_r_o_g_r_a_m _f_o_r _M_a_i_n_t_a_i_n_i_n_g _C_o_m_p_u_t_e_r
_P_r_o_g_r_a_m_s
EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
The following environment variables may be set, however
their use is not recommended as they introduce dependencies
that are not readily apparent when _i_m_a_k_e is run:
IIIIMMMMAAAAKKKKEEEEIIIINNNNCCCCLLLLUUUUDDDDEEEE
If defined, this specifies a ``-I'' include argument to
pass to the C preprocessor. E.g.,
``-I/usr/X11/config''.
IIIIMMMMAAAAKKKKEEEECCCCPPPPPPPP
If defined, this should be a valid path to a
preprocessor program. E.g., ``/usr/local/cpp''. By
default, _i_m_a_k_e will use /lib/cpp.
IIIIMMMMAAAAKKKKEEEEMMMMAAAAKKKKEEEE
If defined, this should be a valid path to a make
program, such as ``/usr/local/make''. By default,
_i_m_a_k_e will use whatever _m_a_k_e program is found using
_e_x_e_c_v_p(_3). This variable is only used if the ``-e''
option is specified.
AAAAUUUUTTTTHHHHOOOORRRR
PPPPaaaaggggeeee 4444 ((((pppprrrriiiinnnntttteeeedddd 4444////33330000////99998888))))
IIIIMMMMAAAAKKKKEEEE((((1111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....1111)))) IIIIMMMMAAAAKKKKEEEE((((1111))))
Todd Brunhoff, Tektronix and MIT Project Athena; Jim Fulton,
MIT X Consortium
Page 5 (printed 4/30/98)